import 'dart:convert';

import 'package:largefriends/entity/json/json_parse_utils.dart';

class LfBadgeEntity {
  LfBadgeEntity({
    this.newLikedMe = 0,
    this.newMessage = 0,
    this.newVisitedMe = 0,
    this.newWinkedMe = 0,
  });

  factory LfBadgeEntity.fromJson(Map<dynamic, dynamic> jsonRes) =>
      LfBadgeEntity(
        newLikedMe: jsonRes.asInt('newLikedMe', 0),
        newMessage: jsonRes.asInt('newMessage', 0),
        newVisitedMe: jsonRes.asInt('newVisitedMe', 0),
        newWinkedMe: jsonRes.asInt('newWinkedMe', 0),
      );

  int newLikedMe;
  int newMessage;
  int newVisitedMe;
  int newWinkedMe;

  @override
  String toString() {
    return jsonEncode(this);
  }

  Map<String, dynamic> toJson() => <String, dynamic>{
        'newLikedMe': newLikedMe,
        'newMessage': newMessage,
        'newVisitedMe': newVisitedMe,
        'newWinkedMe': newWinkedMe,
      };
}
